//
//  CNSex.m
//  BeeQuick_19
//
//  Created by 赵玉忠 on 16/9/24.
//  Copyright © 2016年 CN Team. All rights reserved.
//

#import "CNSex.h"


@interface CNSex()
@property (weak, nonatomic) IBOutlet UIButton *ManButton;
@property (weak, nonatomic) IBOutlet UIButton *GirlButton;

@end
@implementation CNSex
- (IBAction)ManButtonClick:(id)sender {
    self.ManButton.selected = YES;
    self.GirlButton.selected = NO;
    //创建一个消息对象
    NSNotification * notice = [NSNotification notificationWithName:@"MAN" object:nil userInfo:@{@"MAN":@"0"}];
    //发送消息
    [[NSNotificationCenter defaultCenter]postNotification:notice];
}
- (IBAction)GirlButtonClick:(id)sender {
    self.GirlButton.selected = YES;
    self.ManButton.selected = NO;
    
    NSNotification * notice = [NSNotification notificationWithName:@"WOMAN" object:nil userInfo:@{@"WOMAN":@"1"}];
    //发送消息
    [[NSNotificationCenter defaultCenter]postNotification:notice];
}
-(void)chooseSex:(NSInteger)tag{
    if (tag == 0) {
                self.ManButton.selected = YES;
                self.GirlButton.selected = NO;
    }else{
        self.ManButton.selected = NO;
        self.GirlButton.selected = YES;

    }
}
//-(void)awakeFromNib{
//    [super awakeFromNib];
//    if ([self.sex isEqualToString:@"0"]) {
//        self.ManButton.selected = YES;
//        self.GirlButton.selected = NO;
//    }
//    if([self.sex isEqualToString:@"1"]){
//        self.GirlButton.selected = YES;
//        self.ManButton.selected = NO;
//    }
//}

@end
